Ext.define('Usws.view.video.VideoEdit', {
    extend: 'Ext.window.Window',
    xtype: 'Video-Edit',
    title: '编辑视频信息',
    layout: 'column',
    autoShow: true,
    modal: true,
    initComponent: function() {
        this.items = [
            {
                xtype: 'form',
                padding: '10px',
                border: 0,
                items: [
                     { xtype: 'hiddenfield', name:'video.uid', id: 'uid'}
                    ,{ xtype: 'hiddenfield', name:'video.fileUid', id: 'fileUid'}
                    ,{ xtype: 'hiddenfield', name:'videoFile.videoPath', id: 'videoPath'}
                    ,{ xtype: 'hiddenfield', name:'videoFile.snapshot', id: 'snapshot'}
                    ,{ xtype: 'hiddenfield', name:'videoFile.origFileName', id: 'videoOrigFileName'}
                    ,{ xtype: 'hiddenfield', name:'videoFile.fileSize', id: 'videoFileSize'}
                    ,{ xtype: 'hiddenfield', name:'videoFile.mimeType', id: 'videoMimeType'}
                    ,{ xtype: 'hiddenfield', name:'videoFile.fileExt', id: 'videoFileExt'}
					,{ 
						xtype: 'textfield', 
						name:'video.name', 
						id: 'name', 
						fieldLabel: '视频标题', 
						allowBlank:false
					 }
					,{ 
						xtype: 'textareafield',
						name:'video.description',
						id: 'description',
						minWidth:400,
						fieldLabel: '视频简介',
						emptyText:'请输入200字以内的介绍',
						allowBlank:false
					 }
					,{
                        xtype: 'combobox',
                        fieldLabel: '视频类型',
                        name: 'video.typeSid',
                        id:'typeSid',
                        store: 'VideoType',
                        emptyText:'请选择视频类型',
                        valueField: 'sepId',
                        displayField: 'name',
                        typeAhead: true,
                        editable:false,
                        queryMode:'local',
                        allowBlank:false
                    }
					,{
                        xtype: 'combobox',
                        fieldLabel: '视频类别',
                        name: 'video.catUids',
                        id:'catUids',
                        store: 'BaseVideoCat',
                        emptyText:'请选择视频类别',
                        valueField: 'uid',
                        displayField: 'name',
                        typeAhead: true,
                        editable:false,
                        multiSelect:true,
                        queryMode:'local',
                        allowBlank:false
                    }
					
					,{ xtype: 'textfield', name:'video.tags', id:'tags', fieldLabel: '视频标签'}
					,{
						xtype: 'filefield',
			        	name:'file',
			        	id: 'uploadVideoPreviewPic',
			        	buttonText:'选择',
			            fieldLabel: '视频缩略图'
			         }
					,{
						xtype: 'filefield',
			        	name:'file',
			        	id: 'uploadVideo',
			        	buttonText:'选择',
			            fieldLabel: '视频文件'
			         }
					,{xtype: 'textfield', name:'video.playLen', id:'playLen', fieldLabel: '片长',  emptyText:'00:00:00'}
                ]
            }
            
            ,{
                xtype: 'panel',
                border: false,
                bodyPadding: 10,
                layout:'vbox',
                items: [
					        {
					        	xtype:'panel',
					        	id:'previewVideoPreviewPicPanel',
					        	border: false,
					        	items:[
										{
										    xtype: 'displayfield',
										    fieldLabel: '预览视频缩略图'
										},
										{
 											xtype: 'panel',
 								        	border:false,
 										    width:80,
 										    height:60,
 										    id:'previewVideoPreviewPic',
 										    html:'<img src="/images/no_pic.gif" width="80" height="60"/>'
 										}
					        	      ]
					        	
					        }
					       ,
					        {
					        	xtype:'panel',
					        	id:'previewVideoPanel',
					        	border: false,
					        	items:[
										{
										    xtype: 'displayfield',
										    fieldLabel: '预览视频'
										},
										{
											xtype: 'panel',
								        	border:false,
										    id:'previewVideo',
										    width:350,
										    height:160
										    /* html: '<object id="video" width="400" height="200" border="0" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">'
										          +'<param name="ShowDisplay" value="0">'
										          +'<param name="ShowControls" value="1">'
										          +'<param name="AutoStart" value="1">'
										          +'<param name="AutoRewind" value="0">'
										          +'<param name="PlayCount" value="0">'
										          +'<param name="Appearance value="0 value=""">'
										          +'<param name="BorderStyle value="0 value=""">'
										          +'<param name="MovieWindowHeight" value="240">'
										          +'<param name="MovieWindowWidth" value="320">'
										          +'<param name="FileName" value="行走在山梁上 超清.mp4">'
										          +'<embed width="400" height="200" border="0" showdisplay="0" showcontrols="1" autostart="1" autorewind="0" playcount="0" moviewindowheight="240" moviewindowwidth="320" filename="行走在山梁上 超清.mp4" src="行走在山梁上 超清.mp4">'
										          +'</embed>' 
										          +'</object>'
										          */
										    	/*
										          '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '
										          +'CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" WIDTH="300" HEIGHT="150" >'
										          +'<PARAM NAME="src" VALUE="test.mp4" >'
										          +'<PARAM NAME="autoplay" VALUE="true" >'
										          +'<EMBED SRC="test.mp4" TYPE="image/x-macpaint" '
										          +'PLUGINSPAGE="http://www.apple.com/quicktime/download" WIDTH="300" HEIGHT="150" AUTOPLAY="true"></EMBED>'
										          +'</OBJECT>'  */
										}
					        	      ]
					        	
					        } 
                ]
            }
        ];

        this.buttons = [
            {
                text: '确定',
                action: 'save'
            },
            {
                text: '取消',
                scope: this,
                handler: this.close
            }
        ];
        
        this.callParent(arguments);
    }
});